package org.hive.display
{
	import flash.display.Loader;
	import flash.errors.IllegalOperationError;
	import flash.net.URLRequest;
	import flash.system.ApplicationDomain;
	import flash.system.LoaderContext;
	
	import org.hive.display.utils.LoaderSet;
	
	public class LoaderData extends Loader
	{
		public var incrementPassed:Boolean;
		public var loaderset:LoaderSet;
		public var isLoading : Boolean = false;
		public var isLoaded:Boolean = false;
		
		public var request:URLRequest;
		public var context:LoaderContext = new LoaderContext(true,ApplicationDomain.currentDomain);
		
		public function LoaderData( p_request:URLRequest=null, p_name:String=null, p_context:LoaderContext=null )
		{
		    super();
		    super.name = p_name || super.name;
		    request = p_request;
		    context = p_context || context;
		}
		
		override public function load(p_request:URLRequest, p_context:LoaderContext=null):void
		{
		    context = p_context || context; 
		    request = p_request || request;
		    super.load(request, context);
		}
		
		override public function set name(value:String):void
		{
		    throw IllegalOperationError('LoaderData property [name] is read-only.');
		}
		
	}
}